package Java8_24;

public class Cat {
    String name;
    String weight;
    int tili;
    public Cat(String name, String weight,int tili) {
        this.name = name;
        this.weight = weight;
        this.tili=tili;
    }

    public String getName() {
        return name;
    }

    public String getWeight() {
        return weight;
    }
    public int getTili() {
        return tili;
    }
    public void setName(String name) {
        this.name = name;
    }
    public void setTili(int tili) {
        this.name = name;
    }
    public void setWeight(String weight) {
        this.weight = weight;
    }
    public void zhua(Mouse mouse){
        this.tili=tili+mouse.getTili();
        System.out.println("猫抓住了老鼠，猫的体力为"+tili+"老鼠的体力为0");
    }
}
